﻿namespace UnionnetClient.Model
{
	/* 登陆参数--用于内部登陆调用 */
	internal class LoginData
	{
		static internal LoginData Instance
		{	
			get { return new LoginData(); }  //每次新建一个对象，提供了隔离性，避免了正在登陆时更改设置而产生问题
		}

		internal LoginData()
		{
			loginAttemptInterval = AppEnvironment.Settings.LoginAttemptInterval;
			loginTimeout = AppEnvironment.Settings.LoginTimeout;
			postAddress = (string)AppEnvironment.Settings[SettingsProperty.PostAddress];
			postParameters = (string)AppEnvironment.Settings[SettingsProperty.PostParameters];
			isvpn = AppSettings.Instance.IsVPN;
		}

		internal int LoginAttemptInterval
		{
			get { return loginAttemptInterval; }
		}

		internal int LoginTimeout
		{
			get { return loginTimeout; }
		}

		internal string PostAddress
		{
			get { return postAddress; }
		}

		internal string PostParameters
		{
			get { return postParameters; }
		}

		internal bool IsVPN
		{
			get { return isvpn; }
		}

		private int loginAttemptInterval;
		private int loginTimeout;
		private string postAddress;
		private string postParameters;
		private bool isvpn;
	}
}